home *** CD-ROM | disk | FTP | other *** search
- #ifndef _INLINE_MPIMAGE_H
- #define _INLINE_MPIMAGE_H
-
- #include <sys/cdefs.h>
- #include <inline/stubs.h>
-
- __BEGIN_DECLS
-
- #ifndef BASE_EXT_DECL
- #define BASE_EXT_DECL
- #define BASE_EXT_DECL0 extern struct Library * MPImageBase;
- #endif
- #ifndef BASE_PAR_DECL
- #define BASE_PAR_DECL
- #define BASE_PAR_DECL0 void
- #endif
- #ifndef BASE_NAME
- #define BASE_NAME MPImageBase
- #endif
-
- BASE_EXT_DECL0
-
- __inline extern void FreeMPImage( BASE_PAR_DECL struct MPImage *MPi)
- {
- BASE_EXT_DECL
- register void *a6 __asm("a6");
- register struct MPImage *a0 __asm("a0");
-
- a6 = BASE_NAME;
- a0 = MPi;
- __asm volatile ("
- jsr a6@(-0x24)"
- : /* no output */
- : "r" (a6), "r" (a0)
- : "d0", "d1", "a0", "a1" );
- }
- __inline extern struct MPImage* LoadMPImage( BASE_PAR_DECL const char *filename, struct Screen *screen, ULONG Flags)
- {
- BASE_EXT_DECL
- register struct MPImage * res __asm("d0");
- register void *a6 __asm("a6");
- register const char *a0 __asm("a0");
- register struct Screen *a1 __asm("a1");
- register ULONG d0 __asm("d0");
-
- a6 = BASE_NAME;
- a0 = filename;
- a1 = screen;
- d0 = Flags;
- __asm volatile ("
- jsr a6@(-0x1e)"
- : "=r" (res)
- : "r" (a6), "r" (a0), "r" (a1), "r" (d0)
- : "d0", "d1", "a0", "a1" );
- return res;
- }
- __inline extern char * MPImageErrorMessage( BASE_PAR_DECL0 )
- {
- BASE_EXT_DECL
- register char * res __asm("d0");
- register void *a6 __asm("a6");
-
- a6 = BASE_NAME;
- __asm volatile ("
- jsr a6@(-0x2a)"
- : "=r" (res)
- : "r" (a6)
- : "d0", "d1", "a0", "a1" );
- return res;
- }
- __inline extern BOOL RescaleMPImage( BASE_PAR_DECL struct MPImage *MPi, UWORD x, UWORD y )
- {
- BASE_EXT_DECL
- register BOOL res __asm("d0");
- register void *a6 __asm("a6");
- register struct MPImage *a0 __asm("a0");
- register UWORD d0 __asm("d0");
- register UWORD d1 __asm("d1");
-
- a6 = BASE_NAME;
- a0 = MPi;
- d0 = x;
- d1 = y;
- __asm volatile ("
- jsr a6@(-0x36)"
- : "=r" (res)
- : "r" (a6), "r" (a0), "r" (d0), "r" (d1)
- : "d0", "d1", "a0", "a1" );
- return res;
- }
- __inline extern BOOL SaveMPImageA( BASE_PAR_DECL const UBYTE *file, UBYTE *red, UBYTE *green, UBYTE *blue, UWORD width, UWORD height, struct TagItem *TagList )
- {
- BASE_EXT_DECL
- register BOOL res __asm("d0");
- register void *a6 __asm("a6");
- register const UBYTE *a0 __asm("a0");
- register UBYTE *a1 __asm("a1");
- register UBYTE *a2 __asm("a2");
- register UBYTE *a3 __asm("a3");
- register UWORD d0 __asm("d0");
- register UWORD d1 __asm("d1");
- register struct TagItem *a5 __asm("a5");
-
- a6 = BASE_NAME;
- a0 = file;
- a1 = red;
- a2 = green;
- a3 = blue;
- d0 = width;
- d1 = height;
- a5 = TagList;
- __asm volatile ("
- jsr a6@(-0x30)"
- : "=r" (res)
- : "r" (a6), "r" (a0), "r" (a1), "r" (a2), "r" (a3), "r" (d0), "r" (d1), "r" (a5)
- : "d0", "d1", "a0", "a1", "a2", "a3", "a5" );
- return res;
- }
- #ifndef NO_INLINE_STDARG
- #define SaveMPImage(a0, a1, a2, a3, d0, d1, tags...) \
- ({ struct TagItem _tags[] = { tags }; SaveMPImageA ((a0), (a1), (a2), (a3), (d0), (d1), _tags); })
- #endif /* not NO_INLINE_STDARG */
-
- __inline extern void SetMPImageScreen( BASE_PAR_DECL char *ScreenName , ULONG Flags )
- {
- BASE_EXT_DECL
- register void *a6 __asm("a6");
- register char *a0 __asm("a0");
- register ULONG d0 __asm("d0");
-
- a6 = BASE_NAME;
- a0 = ScreenName;
- d0 = Flags;
- __asm volatile ("
- jsr a6@(-0x3c)"
- : /* no output */
- : "r" (a6), "r" (a0), "r" (d0)
- : "d0", "d1", "a0", "a1" );
- }
-
- #undef BASE_EXT_DECL
- #undef BASE_EXT_DECL0
- #undef BASE_PAR_DECL
- #undef BASE_PAR_DECL0
- #undef BASE_NAME
-
- __END_DECLS
-
- #endif /* _INLINE_MPIMAGE_H */
-